package com.jackson.springevent.controller;

/*
 * Author: JacksonCoder
 * FileName: IndexController
 * Version: 1.0.0
 * Date: 2025/5/28
 */

import com.jackson.springevent.publisher.EventPublisher;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
public class IndexController {

    private final EventPublisher eventPublisher;

    @GetMapping("/index")
    public String index() {
        eventPublisher.publishCustomEvent("hello java");
        return "hello java";
    }

}
